/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sdd.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 * @author asabido
 */
@Embeddable
public class OrderProductPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ORDER_id")
    private int oRDERid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PRODUCT_id")
    private int pRODUCTid;

    public OrderProductPK() {
    }

    public OrderProductPK(int oRDERid, int pRODUCTid) {
        this.oRDERid = oRDERid;
        this.pRODUCTid = pRODUCTid;
    }

    public int getORDERid() {
        return oRDERid;
    }

    public void setORDERid(int oRDERid) {
        this.oRDERid = oRDERid;
    }

    public int getPRODUCTid() {
        return pRODUCTid;
    }

    public void setPRODUCTid(int pRODUCTid) {
        this.pRODUCTid = pRODUCTid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) oRDERid;
        hash += (int) pRODUCTid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderProductPK)) {
            return false;
        }
        OrderProductPK other = (OrderProductPK) object;
        if (this.oRDERid != other.oRDERid) {
            return false;
        }
        if (this.pRODUCTid != other.pRODUCTid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sdd.entities.OrderProductPK[ oRDERid=" + oRDERid + ", pRODUCTid=" + pRODUCTid + " ]";
    }
    
}
